﻿<UserControl x:Class="ContactTracing.CaseView.Controls.Diagnostics.DistrictFieldTypeEditor"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:p="clr-namespace:ContactTracing.CaseView.Properties"
             xmlns:controls="clr-namespace:ContactTracing.CaseView.Controls"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="200" d:DesignWidth="530">
    <Border BorderBrush="{StaticResource AccentBrush}" BorderThickness="1" Background="{StaticResource LightBackgroundBrush}"
            Padding="20">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <StackPanel Grid.Row="0" Grid.Column="0" Grid.ColumnSpan="1">
                <Rectangle HorizontalAlignment="Left" Width="100" Height="6" Fill="{StaticResource AccentBrush}" />
                <!--<TextBlock FontSize="24" Foreground="#444444" FontWeight="Bold" Text="{x:Static p:Resources.DataToolsLocationFieldEditorUpper}"/>-->
                <TextBlock FontSize="24" Foreground="#444444" FontWeight="Bold" Text="{x:Static p:Resources.DataToolsLocationFieldEditorUpper}"/>
                
            </StackPanel>

            <StackPanel Grid.Row="1" Height="10"/>

            <StackPanel Grid.Row="2">
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                    </Grid.RowDefinitions>
                    
                    <TextBlock Grid.Row="0" Grid.Column="0" 
                               Margin="0, 2, 4, 2"
                               Text="{Binding Adm1, FallbackValue=District}" />
                    <TextBlock Grid.Row="1" Grid.Column="0" 
                               Margin="0, 2, 4, 2"
                               Text="{Binding Adm2, FallbackValue=Sub-County}" />
                    <TextBlock Grid.Row="2" Grid.Column="0" 
                               Margin="0, 2, 4, 2"
                               Text="{x:Static p:Resources.ColHeaderCountry}" />
                    
                    <RadioButton Grid.Row="0" Grid.Column="1"
                                 GroupName="D"
                              Margin="14, 2, 4, 2"
                              x:Name="checkboxDistrictText" Content="{x:Static p:Resources.DataToolsFreeText}" />

                    <RadioButton Grid.Row="0" Grid.Column="2"
                                 GroupName="D"
                              Margin="4, 2, 4, 2"
                              x:Name="checkboxDistrictDDL" Content="{x:Static p:Resources.DataToolsDropDownList}" />

                    <RadioButton Grid.Row="1" Grid.Column="1"
                                 GroupName="S"
                              Margin="14, 2, 4, 2"
                              x:Name="checkboxSCText" Content="{x:Static p:Resources.DataToolsFreeText}" />

                    <RadioButton Grid.Row="1" Grid.Column="2"
                                 GroupName="S"
                              Margin="4, 2, 4, 2"
                              x:Name="checkboxSCDDL" Content="{x:Static p:Resources.DataToolsDropDownList}" />

                    <RadioButton Grid.Row="2" Grid.Column="1"
                                 GroupName="C"
                              Margin="14, 2, 4, 2"
                              x:Name="checkboxCountryText" Content="{x:Static p:Resources.DataToolsFreeText}" />

                    <RadioButton Grid.Row="2" Grid.Column="2"
                                 GroupName="C"
                              Margin="4, 2, 4, 2"
                              x:Name="checkboxCountryDDL" Content="{x:Static p:Resources.DataToolsDropDownList}" />
                </Grid>
            </StackPanel>
            
            <StackPanel Orientation="Horizontal" VerticalAlignment="Top" HorizontalAlignment="Right" Grid.ColumnSpan="4"
                        IsEnabled="{Binding TaskbarProgressValue, Converter={StaticResource ProgressBarStartButtonEnabledConverter}}">
                <Button Style="{StaticResource PanelCloseButtonStyle}" Margin="0" Command="{Binding ToggleAdminBoundaryFieldEditorCommand}" />
            </StackPanel>

            <StackPanel Margin="0, 10, 0, 0" Grid.Row="4" Orientation="Horizontal" HorizontalAlignment="Right">
                <Button Height="Auto" Click="btnSubmit_Click" Command="{Binding ToggleAdminBoundaryFieldEditorCommand}" Content="{x:Static p:Resources.OK}" />
                <StackPanel Width="10" />
                <Button Height="Auto" Command="{Binding ToggleAdminBoundaryFieldEditorCommand}" Content="{x:Static p:Resources.Cancel}" />
            </StackPanel>
        </Grid>
    </Border>
</UserControl>
